package kr.hkit.powerjava.chapter22.collection;

import java.util.HashMap;
import java.util.Map;

import kr.hkit.powerjava.chapter22.submit2.vo.Student;

public class MapTest {
	public static void main(String[] args) {
		//<Key,Value> 이렇게 출력됨
		//Map는 키 값으로 조정합니다. 
		Map<Integer, Student> map = new HashMap<>();
		map.put(1, new Student(1, "김태희", 90, 90, 90));
		map.put(2, new Student(2, "이민정", 80, 79, 65));
		map.put(3, new Student(3, "효린", 75, 79, 65));
//		map.remove(1); //삭제.
		
		System.out.println(map);
		
		//리턴타입이 map.Entry
		for (Map.Entry<Integer, Student> s: map.entrySet()) {
			int key = s.getKey();
			Student std = s.getValue();
			
			System.out.println("Key : " + key + " Value : " + std); 
		}
	}
}
